<?php
declare (strict_types=1);

namespace app\user\logic\user\admin;

use app\user\model\user\admin\UserLoginRecord as UserLoginRecordModel;

/**
 * 学员登录日志
 */
class UserLoginRecord extends UserLoginRecordModel
{

    /**
     * 获取日志列表
     * Author   Martinsun<syh@sunyonghong.com>
     * Date 2020-08-04
     *
     * @param array $map [description]
     * @return   [type]                              [description]
     */
    public function getList(array $map)
    {
        $where = $map['__TABLE__'];

        return $this
            ->hasWhere('user', $map['user'])
            // ->alias('UserLoginRecord')
            ->with(['user'])
            ->where($where)
            ->order('create_time', 'DESC')
            ->paginate($this->getListRows());
    }
}
